#pragma once

#include <iostream>
#include "Exception.h"

namespace platform {


/**
 * Interface for serializable objects
 */
class ISerializable {
public:
	virtual void saveToStream(std::ostream &os) const = 0;
	virtual void readFromStream(std::istream &is) = 0;

	virtual void writeDebugInfo(std::ostream &os) const { os << "no debug info"; }
};

class SerializationException : public Exception {
public:
	inline SerializationException(const char *file, unsigned long line, const char *msg) throw ()
	: Exception(file, line, msg)
	{}
};


}  // end namespace
